<?php

/**
 * language actions.
 *
 * @package    Moncada
 * @subpackage language
 * @author     Federico Motta - Andrea Burza
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class languageActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
   public function executeChangeLanguage(sfWebRequest $request)
  {
    $form = new sfFormLanguage(
      $this->getUser(),
      array('languages' => array('it', 'en'))
    );
 
    $form->process($request);
 
    return $this->redirect('@localized_homepage');
  }
  
  public function executeChange(sfWebRequest $request){
	  $this->getUser()->setCulture($request->getParameter('lang'));
	  //return $this->redirect($request->getParameter('rout'));
	  return $this->redirect('@localized_homepage');
	}

}
